@extends('admin.common.base-master')

@section('html-head')
    <link href="{{url('css/jquery.form.css')}}" type="text/css" rel="stylesheet" />
    {{--<script src="{{url('/vendor/My97DatePicker/WdatePicker.js')}}"></script>--}}
    <script src="{{url('/js/lib/jquery.form.js')}}"></script>
    <link href="{{url('css/admin/pagenum.css')}}" rel="stylesheet" />
    <link rel="stylesheet" href="{{url("css/autocomplete.css")}}">
    <script src="{{url('js/autocomplete.js')}}"></script>
    <style>
        .sx{padding: 10px}
        .sx-btn{width: 64px;height: 30px;background-color: #4dbcd3;color: #fff;border: #4dbcd3;border-radius: 7%;}
        .autocomplete-button{
            display: none;
        }
        .proposal-list li{
            background-color: white !important;
        }
        li.proposal.selected{
            background-color: rgb(175, 42, 0) !important;
        }
    </style>
@endsection

@section('html-body')
    <div id="content">
        <!-- cur-position start -->
        <div id="cur-position">
            <span class="tit">当前位置：</span>
            <a href="#">用户管理</a>
            <em> > </em>
            <a href="#">vip列表</a>
        </div>

        <!--二级目录-->
        @include('admin.common.user-header')

        <div class="filter-box clearfix">
            <div class="fl" style="display: inline-flex">
                <div class="sx">
                    <input class="gg-ipt" style="width: 180px;height: 26px" type="text" placeholder="输入昵称" name="nickname" id="nickname" value="{{$nickname}}" />
                </div>
                <div class="sx">
                    <button class="sx-btn" id="sou_btn">搜索</button>
                </div>
            </div>
        </div>

        <div class="filter-box clearfix">
        </div>
        <div class="table-box">
            <table class="table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户昵称</th>
                    <th>用户头像</th>
                    <th>类型</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                </tr>
                </thead>
                <tbody>
                @if(count($thisUserVIpList) > 0)
                    @foreach($thisUserVIpList as $thisUserVIp)
                        <tr id="userVip_{{$thisUserVIp->id}}">
                            <td>{{$thisUserVIp->id}}</td>
                            <td>{{$thisUserVIp->nickname}}</td>
                            <td><img src="{{$thisUserVIp->photo_url}}" alt="" width="50"></td>
                            <td>
                                @if($thisUserVIp->type == 'global_vip')
                                    vip
                                @else
                                    {{$thisUserVIp->classify_name}}
                                @endif
                            </td>
                            <td>{{$thisUserVIp->start_time}}</td>
                            <td>{{$thisUserVIp->end_time}}</td>
                        </tr>
                    @endforeach
                @endif
                </tbody>
            </table>
        </div>
        <?php echo $thisUserVIpList->appends(['nickname' => $nickname])->render(); ?>
    </div>
    <script>
        $(function(){
            $('#sou_btn').click(function () {
                var nickname  = $("#nickname").val();

                window.location.href = "{{route('Admin.Home.userVipList')}}?nickname="+nickname;
            });
        });
    </script>
@endsection